#声明一个变量存款存储
mymoney = 0
#开启交互循环
while True:
	print("="*12,"存款管理系统","="*12)
	print("{0:7}{1:13}{2:15}".format("","1.登入","2.退出"))
	key = input("请输入您的选择：")
	if key == "1":
		while True:        			#第二层交互循环
			print("="*12,"已登入您的账户","="*12)
			print("{0:7}{1:13}{2:15}".format("","1.查询余额","2.取钱"))
			print("{0:7}{1:13}{2:15}".format("","3.存钱","4.退出账户"))
			key2 = input("请输入您的选择：")
			if key2 == "1":         #查询余额分支结构
				print("="*40)
				print("您的余额为：",mymoney,"元")
				print("="*40)
				input("按任意键继续")
			elif key2 == "2":		#取钱分支结构
				print("="*40)
				print("您的余额为：",mymoney,"元")
				print("="*40)
				quqian = int(input("请输入取出的钱数："))		#声明一个变量存储取钱数
				if quqian >0:			#如果取钱数为正数再进行操作
					if mymoney <quqian: 		#如果取的钱数大于存款数分支结构
						print("="*12,"余额不足","="*12)
						input("按任意键继续")
					else:											
						print("="*40)
						print("已为您取出",quqian,"元")
						mymoney -=quqian
						print("您的余额为：",mymoney,"元")
						print("="*40)
						input("按任意键继续")				
				else:							#如果取钱数输入不正常分支结构
					print("请输入正确的取款额")
			elif key2 == "3":				#存款分支结构
				print("="*40)
				print("您的余额为：",mymoney,"元")
				print("="*40)
				cunqian = int(input("请输入存入的钱数："))		#声明一个变量存储存款数
				if cunqian >0:				#存管数为正整数判断
					print("="*40)
					print("已为您存入",cunqian,"元")
					mymoney +=cunqian
					print("您的余额为：",mymoney,"元")
					print("="*40)
					input("按任意键继续")					
				else:
					print("请输入正确的取款额")		#存款数输入不正常分支结构
			elif key2 == "4":					#退出账户分支结构
				print("="*12,"已退出账户","="*12)
				input("按任意键继续")
				break
			else:
				print("="*12,"输入有误","="*12)
				input("按任意键继续")
	elif key == "2":			#退出系统分支结构
		print("="*12,"再见","="*12)
		break
	else:
		print("="*12,"输入有误","="*12)
		input("按任意键继续")